package com.cedric.yixianpai.game.cards.Sects.swordCards.a_LianQi;

import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 骤风剑
 */
@Component
public class ZhouFengJian extends SwordCard {

    /**
     * 骤风剑 2x3/4/6
     * @param level 1/2/3
     */
    public ZhouFengJian(@Value("1") int level) {
        super("骤风剑");
        this.setPeriod(Period.LIANQI);
        this.setDescription("2x3/4/6攻");

        if (1 == level) {
            this.setLevel(1);
            this.setDamage(3);
        } else if (2 == level) {
            this.setLevel(2);
            this.setDamage(4);
        } else if (3 == level) {
            this.setLevel(3);
            this.setDamage(6);
        }else {
            throw new RuntimeException("错误的卡牌等级！");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        for(int i=0;i<2;i++){
            Sta1.attack(Sta2,this.getDamage());
        }
        Sta1.getPlayerBuff().setSwordIntent(0);
        return true;
    }
}
